package chapter13;

import chapter11.Role;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2018-04-17 下午2:21
 */
public class TestDemo2 {
    public static void main(String[] args) {
        List<Role> roles = new ArrayList<>();
        for (int i = 0; i < 3; i++) {
            Role r = new Role();
            r.setRoleName("test-" + i);
            r.setNote("test note");
            roles.add(r);
        }
        ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:application.xml");
        UserListService service = ctx.getBean(UserListService.class);
        service.addList(roles);
    }
}
